package com.zzc.emotisenseclassroom.controller.emotisenseScore;

import com.zzc.common.response.ZzcResponse;
import com.zzc.emotisenseclassroom.common.ResponseCodeEnum;
import com.zzc.emotisenseclassroom.domain.classScore.service.ClassScoreService;
import com.zzc.emotisenseclassroom.domain.classScore.dto.BarAndPieOptionRequestDTO;
import com.zzc.emotisenseclassroom.domain.classScore.dto.LineOptionRequestDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Copyright Zzc
 * FileName: ClassScoreContoller
 * Author:   Zzc
 * Date:     2024/5/312:27
 * Description:班级专注度评分统计控制器
 * hISTORY:
 * <author>  <time>     <version>    <desc>
 * 作者姓名   修改时间       版本号       描述
 * Zzc                   1.0.0
 */
@RestController
@RequestMapping("/classScore")
public class ClassScoreController {
    @Autowired
    private ClassScoreService classScoreService;

    /**
     * 获取班级折线图数据
     * @return 班级折线图数据
     */
    @PostMapping("/line")
    public ZzcResponse getClassLineOption(@RequestBody LineOptionRequestDTO requestDTO){
        return ZzcResponse.success(ResponseCodeEnum.GET_LINE_OPTION_SUCCESS, classScoreService.getLineOption(requestDTO));
    }

    @PostMapping("/barAndPie")
    public ZzcResponse getClassBarAndPieOption(@RequestBody BarAndPieOptionRequestDTO requestDTO){
        return ZzcResponse.success(ResponseCodeEnum.GET_BAR_AND_PIE_OPTION_SUCCESS, classScoreService.getBarAndPieOption(requestDTO));
    }
}
